/* gm_sim_utils.h -- Utilidades
 *  
 * Copyright (C) 2008, Gustavo Campos Martins <>
 * GEAR - Grupo de Estudos Avançados em Robótica
 * <http://www.sel.eesc.usp.br/gear>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <semaphore.h>

#include "chipmunk/chipmunk.h"

/** CONSTANTES **/
#define NUM_ROB 10 
#define ROBOT_RADIUS 30.0
#define BALL_RADIUS 8.0
#define FIELD_BL   cpv(100.0, 50.0)
#define FIELD_BR   cpv(1200.0, 50.0)
#define FIELD_UR   cpv(1200.0, 750.0)
#define FIELD_UL   cpv(100.0, 750.0)
#define WORLD_BL   cpv(50.0, 0.0)
#define WORLD_BR   cpv(1250.0, 0.0)
#define WORLD_UR   cpv(1250.0, 800.0)
#define WORLD_UL   cpv(50.0, 800.0)
#define GOALOUR_B  cpv(100.0, 330.0)
#define GOALOUR_U  cpv(100.0, 450.0)
#define GOALOPP_B  cpv(1200.0, 330.0)
#define GOALOPP_U  cpv(1200.0, 450.0)
#define PI 3.1416
#define DEG2RAD PI/180
#define RAD2DEG 180/PI
#define SLEEP_TICKS 10

typedef struct gm_sim_t gm_sim_t;

/** Estrutura com dados utilizados pelo simulador **/
struct gm_sim_t
{ 
	cpSpace *space;
	cpBody *robot[NUM_ROB];
	cpBody *ball;

	int kick[NUM_ROB];
	int placar_a, placar_b;

	/* variáveis auxiliares */
	int mouseState;
	int dx, dy;
	int physics_quit;

	sem_t change;
};

